hotfix the hotfix of the hotfix: do not modify object being iterated over