input validation works better