tweaked error handling for garbage input into the textfield