fixed crash bug in dealloc method