diff --git a/src/ModelTree.cc b/src/ModelTree.cc
index 1dec13509ad36eab636e21813b07507f7bff206e..ed9410a3e5177f49567b3bcb263be0c1a9d7ab3a 100644
--- a/src/ModelTree.cc
+++ b/src/ModelTree.cc
@@ -1113,6 +1113,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 ";