implements validations