validate user input