diff --git a/pyfstat/grid_based_searches.py b/pyfstat/grid_based_searches.py
index 8ef2ca13d04fc58bb5cbd67208df06d8f867862c..73941001c7ac79e0fc68b9854b75f56b811e6e7c 100644
--- a/pyfstat/grid_based_searches.py
+++ b/pyfstat/grid_based_searches.py
@@ -265,7 +265,10 @@ class GridSearch(BaseSearchClass):
             print('  {}={}'.format(k, v))
 
     def set_out_file(self, extra_label=None):
-        dets = self.detectors.replace(',', '')
+        if self.detectors:
+            dets = self.detectors.replace(',', '')
+        else:
+            dets = 'NA'
         if extra_label:
             self.out_file = '{}/{}_{}_{}_{}.txt'.format(
                 self.outdir, self.label, dets, type(self).__name__,