Index: /branches/eam_branches/ohana.20170822/src/delstar/src/delete_measures_by_detID.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/delstar/src/delete_measures_by_detID.c	(revision 40176)
+++ /branches/eam_branches/ohana.20170822/src/delstar/src/delete_measures_by_detID.c	(revision 40177)
@@ -97,5 +97,5 @@
     }
   }
-  fprintf (stderr, "found %d uniq catIDs\n", NcatID);
+  // fprintf (stderr, "found %d uniq catIDs\n", NcatID);
 
   ALLOCATE_PTR (catIDgroup, CatIDGroup, NcatID);
@@ -132,4 +132,6 @@
   for (i = 0; i < skylist[0].Nregions; i++) {
 
+    if (VERBOSE) fprintf (stderr, "checking %s : %d, %d\n", skylist[0].regions[i]->name, skylist[0].regions[i]->index, skylist[0].regions[i]->hostID);
+
     // does this host ID match the desired location for the table?
     if (!HostTableTestHost(skylist[0].regions[i], HOST_ID)) continue;
@@ -161,5 +163,5 @@
     }
 
-    int myCatID = thisCatID (catID, NcatID, skylist[0].regions[i]->index);
+    int myCatID = thisCatID (catIDuniq, NcatID, skylist[0].regions[i]->index);
     myAssert (myCatID >= 0, "error");
 
@@ -388,5 +390,5 @@
   if (SAVE_DELETES) {
     char savename[DVO_MAX_PATH];
-    snprintf (savename, DVO_MAX_PATH, "%s.save.20171019", catalog->filename);
+    snprintf (savename, DVO_MAX_PATH, "%s.save.20171019.v1", catalog->filename);
     struct stat filestat;
     int myStatus = stat (savename, &filestat);
Index: /branches/eam_branches/ohana.20170822/src/delstar/src/delstar_client.c
===================================================================
--- /branches/eam_branches/ohana.20170822/src/delstar/src/delstar_client.c	(revision 40176)
+++ /branches/eam_branches/ohana.20170822/src/delstar/src/delstar_client.c	(revision 40177)
@@ -37,4 +37,11 @@
     case MODE_DELETE_MEASURES_BY_MATCH:
       if (!delete_measures_by_match ()) exit (1);
+      delstar_args_free ();
+      ohana_memcheck (TRUE);
+      ohana_memdump (TRUE);
+      exit (0);
+      break;
+    case MODE_DELETE_MEASURES_BY_DETID:
+      if (!delete_measures_by_detID ()) exit (1);
       delstar_args_free ();
       ohana_memcheck (TRUE);
