Checks for invalid input