add "preEnd" event to context