adding commit method