added some validations to model