improve the range check in the commit model