Fixed issue related to modified collection while it's being enumerated