add commit method