check if the entered number is valid