added some validations; added tests for validations