fix for error when spawning mobs