fixed file could not be closed if mapsting wasn't found