Fixed a bug where destroy events wasn't triggered