Fixed a spawning bug