added validations adn error messages