added validations code