inject beforeDestroy and afterDestroy lifecycle callbacks