Fix the bug that throws concurrentModificationException.