Fixed closing file