added validations for user input