Added checks for user input