Emit beforeUpdate and afterUpdate events