fixed input validation