better validation of numeric ranges