prevent upperLimit goes less than lowerLimit