fix handling of invalid input