add event handlers before and after insert update and delete