Check for invalid input