diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index ba5b30e8827509d03131b195dbe11f98278e6915..08d38348f1cbb134bb09fad4c2d2bc865ef915f9 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -1367,6 +1367,8 @@ ModelTree::writeModelLocalVariableTemporaryTerms(temporary_terms_t &temp_term_un
 
   for (auto &it : temporary_terms_mlv)
     {
+      it.second->writeExternalFunctionOutput(output, output_type, temp_term_union, tt_idxs, tef_terms);
+
       if (isJuliaOutput(output_type))
         output << "    @inbounds const ";