Fixed conditional bug with user input validation