fixed crash on removing entities