commit to prevent data loss