Add close file, commit all updates at first