diff --git a/dumux/porousmediumflow/nonisothermal/indices.hh b/dumux/porousmediumflow/nonisothermal/indices.hh
index a53dfef4702382c79482d7ccf5c427e3cdc373c9..febb62ffdb89f8182910ff83d0cb34bd2f355aaf 100644
--- a/dumux/porousmediumflow/nonisothermal/indices.hh
+++ b/dumux/porousmediumflow/nonisothermal/indices.hh
@@ -37,11 +37,11 @@ namespace Dumux
  * \tparam formulation The formulation, either pwsn or pnsw.
  * \tparam PVOffset The first index in a primary variable vector.
  */
-template <class TypeTag, int PVOffset = 0>
-class EnergyIndices : public GET_PROP_TYPE(TypeTag, IsothermalIndices)
+template <class IsothermalIndices, int numEquation, int PVOffset = 0>
+class EnergyIndices : public IsothermalIndices
 {
 public:
-    static const int numEq = GET_PROP_VALUE(TypeTag, NumEq);
+    static const int numEq = numEquation;
     static const int temperatureIdx = PVOffset + numEq -1; //!< The index for temperature in primary variable vectors.
     static const int energyEqIdx = PVOffset + numEq -1; //!< The index for energy in equation vectors.
 
diff --git a/dumux/porousmediumflow/nonisothermal/model.hh b/dumux/porousmediumflow/nonisothermal/model.hh
index f0ecd5208aa2c3b58929578d73836a76afa24970..a7aec809d986d3e7ef763cb7c8f62fe4891d7ab7 100644
--- a/dumux/porousmediumflow/nonisothermal/model.hh
+++ b/dumux/porousmediumflow/nonisothermal/model.hh
@@ -68,7 +68,14 @@ SET_BOOL_PROP(NonIsothermal, EnableEnergyBalance, true);
 SET_INT_PROP(NonIsothermal, NumEq, GET_PROP_VALUE(TypeTag, IsothermalNumEq) + 1);
 
 //! indices for non-isothermal models
-SET_TYPE_PROP(NonIsothermal, Indices, EnergyIndices<TypeTag, 0>);
+SET_PROP(NonIsothermal, Indices)
+{
+private:
+    using IsothermalIndices = typename GET_PROP_TYPE(TypeTag, IsothermalIndices);
+    static constexpr int numEq = GET_PROP_VALUE(TypeTag, NumEq);
+public:
+    using type = EnergyIndices<IsothermalIndices, numEq, 0>;
+};
 
 //! indices for non-isothermal models
 SET_TYPE_PROP(NonIsothermal, VtkOutputFields, EnergyVtkOutputFields<TypeTag>);