commit before closing