refactor error handler, add a callback
update updated_at on update