diff --git a/MuonSpectrometer/MuonPhaseII/MuonPatternRecognition/MuonSpacePointFormation/src/SpacePointMakerAlg.cxx b/MuonSpectrometer/MuonPhaseII/MuonPatternRecognition/MuonSpacePointFormation/src/SpacePointMakerAlg.cxx
index 24a967d6725a82fe534aa52608f0978e7b2c4969..4b9d89eda590f7b585d7d8fa95bd57d613fedf57 100644
--- a/MuonSpectrometer/MuonPhaseII/MuonPatternRecognition/MuonSpacePointFormation/src/SpacePointMakerAlg.cxx
+++ b/MuonSpectrometer/MuonPhaseII/MuonPatternRecognition/MuonSpacePointFormation/src/SpacePointMakerAlg.cxx
@@ -317,7 +317,7 @@ void SpacePointMakerAlg::distributePointsAndStore(
     // Sorter
     MuonR4::SpacePointPerLayerSorter sorter(m_idHelperSvc.get());
 
-    auto newBucket = [this, &lastPointPos, &splittedHits, &sorter] () {
+    auto newBucket = [this, &splittedHits, &sorter] () {
         SpacePointBucket& newContainer = splittedHits.emplace_back();
         newContainer.setBucketId(splittedHits.size() -1);