Add preDispatch and postDispatch event