fixed crash when registering entity spawns