added validations with tests