diff --git a/matlab/perfect-foresight-models/perfect_foresight_solver.m b/matlab/perfect-foresight-models/perfect_foresight_solver.m
index 4a89e0f4f15277e2931801dafcf20704e83d211f..1e6b517751af05742af938bd681302e034b0866a 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_solver.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_solver.m
@@ -23,7 +23,7 @@ function [oo_, ts]=perfect_foresight_solver(M_, options_, oo_, no_error_if_learn
 % SPECIAL REQUIREMENTS
 %   none
 
-% Copyright © 1996-2023 Dynare Team
+% Copyright © 1996-2024 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -55,7 +55,7 @@ end
 periods = options_.periods;
 
 if options_.debug
-    model_static = str2func([M_.fname,'.static']);
+    model_static = str2func([M_.fname,'.sparse.static_resid']);
     for ii=1:size(oo_.exo_simul,1)
         [residual(:,ii)] = model_static(oo_.steady_state, oo_.exo_simul(ii,:),M_.params);
     end