Validate user input