form validation and model update