Add afterDestroy and beforeDestroy events.