fixed spawning problems