validateUserInput() to validate user input