added checks for min==max
switched from callback to trigger counter comparison