diff --git a/dumux/multidomain/subdomainstaggeredlocalassembler.hh b/dumux/multidomain/subdomainstaggeredlocalassembler.hh
index 58a56488725afa329d2364c22897d7849c91704a..ace57abc8eb028ccb13efff7839bb244af15d77e 100644
--- a/dumux/multidomain/subdomainstaggeredlocalassembler.hh
+++ b/dumux/multidomain/subdomainstaggeredlocalassembler.hh
@@ -382,7 +382,7 @@ private:
             if (problem().isDirichletCell(this->element(), this->fvGeometry(), this->fvGeometry().scv(cellCenterGlobalI), eqIdx + offset))
             {
                 using namespace Dune::Hybrid;
-                forEach(integralRange(Dune::Hybrid::size(jacRow)), [&](auto&& i)
+                forEach(integralRange(Dune::Hybrid::size(jacRow)), [&, domainId = domainId](auto&& i)
                 {
                     auto& ccRowI = jacRow[i][cellCenterGlobalI];
                     for (auto col = ccRowI.begin(); col != ccRowI.end(); ++col)