Fixed a concurrent modification error.