validation and beforesave rules