adding on update event