Fixed a crash on dealloc