closing file works