add mutex for allocator