added helper method that fixes the range of the input in a textfield