diff --git a/matlab/TCV/gdat_tcv.m b/matlab/TCV/gdat_tcv.m
index 796f3c0e1e5a39d7c799a6f5713d83a531ba178a..b2c79d0c691685e60e02a250b6fe2705c3d3b47e 100644
--- a/matlab/TCV/gdat_tcv.m
+++ b/matlab/TCV/gdat_tcv.m
@@ -140,7 +140,7 @@ if nargin>=1
   if isempty(shot)
     % means mdsopen(shot) already performed or not shot asked for
     try
-      if ~mdsremotelist
+      if isempty(mdsipmex(8))
 	shot_mds = shot;
       else
 	shot_mds = mdsipmex(2,'$SHOT');
@@ -158,7 +158,7 @@ if nargin>=1
 	    warning(['shot cannot be opened with ' data_request.data_request]);
 	    return
 	  end
-        elseif ischar(data_request) 
+        elseif ischar(data_request)
 	  if ~strcmp(data_request,'ids')
 	    warning(['shot cannot be opened with ' data_request]);
 	    return