fix auto commit condition