input validation working