diff --git a/GeoModelRead/src/ReadGeoModel.cpp b/GeoModelRead/src/ReadGeoModel.cpp
index 1423ba3b2a2ac549777e9fd4bb04391177c95b44..47c8868a028f08df133eee8ff466225a89f5ee9e 100644
--- a/GeoModelRead/src/ReadGeoModel.cpp
+++ b/GeoModelRead/src/ReadGeoModel.cpp
@@ -543,10 +543,11 @@ void ReadGeoModel::loopOverAllChildrenInBunches()
         const unsigned int stop = start + len;
         std::vector<std::vector<std::string>>::const_iterator first = m_allchildren.begin() + start;
         std::vector<std::vector<std::string>>::const_iterator last  = m_allchildren.begin() + stop;
+        std::vector<std::vector<std::string>>::const_iterator end   = m_allchildren.end();
         if ( bb == (nThreads - 1) ) { // last bunch
-           bunch = std::vector<std::vector<std::string>>(first, m_allchildren.end());
-//          bunch = bunchIn;
-        } else { // all bunches but last one
+          bunch = std::vector<std::vector<std::string>>(first, end);
+        }
+        else { // all bunches but last one
            bunch = std::vector<std::vector<std::string>>(first, last);
         }