       (.addWindowListener
         (proxy [WindowAdapter] []
           (windowClosing [e]
-            (println frame)
+            (clear-queues)
             (save-data-and-settings
               (get-last-collection-name)
                 (get-current-data-and-settings))

        (map remove-location
          (remove nil?
            (for [location-row selected-rows]
              (do (println (.getValueAt location-model location-row 0))
                  (.getValueAt location-model location-row 0))))))
      (.fireTableDataChanged location-model))))
    
(defn clear-history []
  (remove-location ""))

                  (let [location (.take pending-locations)]
                    (if-not (= location pending-locations)
                      (do (doseq [data-set (find-data-sets location)]
                           ; (println "data-set:" data-set)
                            (.put pending-data-sets [data-set location]))
                          (recur))
                    nil))
