Adding validation of user input.