diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc
index 4f61891c1f7d4d3a427201bcf2af5a5fc2342a43..b393085aaabb5b9c5f8698e5336e441335af9215 100644
--- a/src/ComputingTasks.cc
+++ b/src/ComputingTasks.cc
@@ -5007,7 +5007,8 @@ VarExpectationModelStatement::writeOutput(ostream &output, const string &basenam
 {
   string mstruct = "M_.var_expectation." + model_name;
   output << mstruct << ".var_model_name = '" << var_model_name << "';" << endl
-         << mstruct << ".horizon = " << horizon << ';' << endl;
+         << mstruct << ".horizon = " << horizon << ';' << endl
+         << mstruct << ".variable = '" << variable << "';" << endl;
   auto disc_var = dynamic_cast<const VariableNode *>(discount);
   if (disc_var)
     output << mstruct << ".discount_index = " << disc_var->get_symb_id() << ';' << endl;