added events on create and update