diff --git a/Convert_Matlab/inst_eddies_v6.py b/Convert_Matlab/inst_eddies_v6.py
index 33d796a20c88db0154dcb114e6c5315e62052085..82c2b5ca79bdf68f9bf1bb64bf6d8ef5765fd415 100755
--- a/Convert_Matlab/inst_eddies_v6.py
+++ b/Convert_Matlab/inst_eddies_v6.py
@@ -157,6 +157,9 @@ if filter_ghosts:
     with open("node_id_param.json") as f: node_id_param = json.load(f)
     n1 = (d - node_id_param["d_init"]) * node_id_param["e_overestim"] + 1
     # (same starting node id for both orientations)
+else:
+    cell_mask = itertools.repeat(False) # no ghost
+
 # There are two factories, one for cyclones and one for anticyclones:
 factories = [dict(writers = {}, cell_name = "Anticyclonic_Cell",
                   cyclone = False, SHPC = "SHPC_anti", id = "id_anti_cell"),
@@ -201,8 +204,6 @@ while True:
                     = id_array.compressed() == np.arange(n1, n1 + n_eddies)
                 assert np.all(equal_range)
                 cell_mask = id_array.mask
-            else:
-                cell_mask = itertools.repeat(False) # no ghost
                 
             write_to_shp(factory["writers"], factory["cyclone"], d,
                          matlab_data[factory["cell_name"]], matlab_data["X"],