test for valid input