fix #1215 / Avoid ConcurrentModification during iteration