rewrite validations using messages