Remove dead entities after loop