Index: trunk/ippTools/src/detselect.c
===================================================================
--- trunk/ippTools/src/detselect.c	(revision 9440)
+++ trunk/ippTools/src/detselect.c	(revision 9467)
@@ -135,5 +135,8 @@
     }
 
-    // psStringAppend(&query, " LIMIT 1");
+    // XXX this needs to be more controlled: we should specifically choose the 
+    // single detrend image which matches all criteria and has the latest 
+    // insertion date
+    psStringAppend(&query, " LIMIT 1");
 
     if (!p_psDBRunQuery(config->dbh, query)) {
