Added beforeDestoy callback to destoy method
Merged changes