check for invalid input