Close file at finish