fixed spawning bug