fix the ConcurrentModificationException properly