Add error handling to update; add constraint checking to update