fix autocommit bugs