fixed rendering issue when entities are destroyed