input validation works