codes for commit and update