Commit before shutting down