Close file in the end