diff --git a/matlab/compute_Pinf_Pstar.m b/matlab/compute_Pinf_Pstar.m
index 2fbae5b330d552ccf43b2f38ce318d83b46d7beb..03db4b972cac1876e8855e33e20e99d51a73c534 100644
--- a/matlab/compute_Pinf_Pstar.m
+++ b/matlab/compute_Pinf_Pstar.m
@@ -105,7 +105,7 @@ end
 Pinf = zeros(np,np);
 Pinf(1:nk,1:nk) = eye(nk);
 for k = 1:nk
-    if norm(QT(mf,k)) < 1e-8
+    if norm(QT(mf,:)*ST(:,k)) < 1e-8
         Pinf(k,k) = 0;
     end
 end