Update commit() function