add save and update form functionality