better validation on update and save