Added commit error logic