fix commit logic