fixed user input validation bug