diff --git a/src/ComputingTasks.cc b/src/ComputingTasks.cc
index 98160e519052e4a0f7c8f8b564b5522441f363db..859ccfc6c99dbb2c205c5823f40b0b98786c09d1 100644
--- a/src/ComputingTasks.cc
+++ b/src/ComputingTasks.cc
@@ -4965,7 +4965,7 @@ MethodOfMomentsStatement::writeOutput(ostream &output, const string &basename, b
 {
   options_list.writeOutput(output, "options_mom_");
 
-  output << "[oo_, options_mom_, M_] = method_of_moments(bayestopt_, options_, oo_, estim_params_, M_, options_mom_);" << endl;  
+  output << "[oo_, options_mom_, M_] = mom.run(bayestopt_, options_, oo_, estim_params_, M_, options_mom_);" << endl;  
 }
 
 void