Checks user input