             (fn []
               (dorun (loop []
                 (try
+                  (Thread/sleep 5)
                   (let [location (.take pending-locations)]
                     (if-not (= location pending-locations)
                       (do (doseq [data-set (find-data-sets location)]

        (if (= (.getStateChange e) ItemEvent/SELECTED)
          (condp = item
            "New..." (create-new-collection)
            (apply-data-and-settings item (load-data-and-settings item)))
          (save-data-and-settings item (get-current-data-and-settings)))))))

(defn create-browser []



(defn apply-data-and-settings [collection-name settings]
  (clear-queues)
  (update-collection-menu collection-name)
  (set-last-collection-name collection-name)
  (let [table (@browser :table)
