Adds support for "destroy" event on elements