fixed memory corruption bug in id allocator