properly check for user input