fixed a crash caused by allocator bug