writing custom validations