make enity spawning more threadsafe