Added validation of the entered data