Trigger event before removing element

The event must be triggered before the element is removed, else it won't work.