diff --git a/ComputingTasks.cc b/ComputingTasks.cc
index 1d86564e0af4bdecc6d650fe7a7f0fa5320ae148..7700ebc20388974431f96112ce36a6626efa010b 100644
--- a/ComputingTasks.cc
+++ b/ComputingTasks.cc
@@ -1534,6 +1534,22 @@ PlannerObjectiveStatement::checkPass(ModFileStructure &mod_file_struct, WarningC
   mod_file_struct.planner_objective_present = true;
 }
 
+Statement *
+PlannerObjectiveStatement::cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table)
+{
+  try
+    {
+      model_tree->reindex(orig_symbol_table);
+    }
+  catch (...)
+    {
+      cerr << "ERROR: A variable in the planner_objective statement was not found in the symbol table" << endl
+           << "       This likely means that you have declared a varexo that is not used in the model" << endl;
+      exit(EXIT_FAILURE);
+    }
+  return new PlannerObjectiveStatement(model_tree);
+}
+
 StaticModel *
 PlannerObjectiveStatement::getPlannerObjective() const
 {
diff --git a/ComputingTasks.hh b/ComputingTasks.hh
index 4eedddb4b08e73b0dd746e3653e3c1b75af3424b..fdb894ee355528059b50cc01a086bbbefce2fa76 100644
--- a/ComputingTasks.hh
+++ b/ComputingTasks.hh
@@ -390,6 +390,7 @@ public:
   virtual void writeOutput(ostream &output, const string &basename) const;
   //! Return the Planner Objective
   StaticModel *getPlannerObjective() const;
+  virtual Statement *cloneAndReindexSymbIds(DataTree &dynamic_datatree, SymbolTable &orig_symbol_table);
 };
 
 class BVARDensityStatement : public Statement