Fixed bug in unmount