diff --git a/Src/GroupTree/FGroupSeqAlgorithm.hpp b/Src/GroupTree/FGroupSeqAlgorithm.hpp
index 5e94bd41df5695319da3de749436beb58269795d..11467dc4bbbe10fa3af6b5ec1c0d8a20e5abc216 100644
--- a/Src/GroupTree/FGroupSeqAlgorithm.hpp
+++ b/Src/GroupTree/FGroupSeqAlgorithm.hpp
@@ -277,7 +277,7 @@ protected:
             while(iterParticles != endParticles && iterCells != endCells){
                 { // Can be a task(in:iterCells, inout:iterParticles)
                     const MortonIndex blockStartIdx = (*iterCells)->getStartingIndex();
-                    const MortonIndex blockEndIdx = (*iterCells)->getStartingIndex();
+                    const MortonIndex blockEndIdx = (*iterCells)->getEndingIndex();
 
                     for(MortonIndex mindex = blockStartIdx ; mindex < blockEndIdx ; ++mindex){
                         CellClass* cell = (*iterCells)->getCell(mindex);