Fixed a bug "the collection was changed being enumerated".