fix zero division error for groups with input range