verify data before saving with hooks