closing file in main