revise the algorithm of closing file