Added condition to check user input