   (swap! channels (fn [old]
 
                     (let [all (reduce (fn [accum key]
-                                        (if (closed? (get old key))
+                                        (if (closed? (get accum key))
                                           (do
                                             (println "Getting rid of old connection for " key)
-                                           (dissoc old key))
-                                          old)) old (keys old))
+                                            (dissoc accum key))
+                                          accum)) old (keys old))
                           url-ch (or (get all url)
                                      (let [new-ch (channel)]
                                        (println "creating a channel for url " url)


   :list
   {:resource (fn [uri binding meta vals]
                (hic/html [:p (:title meta)]
                          [:ol.list-binding {:data-uri uri
                                :data-binding binding
                                :data-description (:description meta)}
                           vals]
                          [:a.list-add-binding
                           {:href "#"
                            :data-uri uri
                            :data-binding binding} "Create"]))
    :value (fn [parent uri binding meta val]
             (hic/html [:li {:data-uri uri} val]))

    :update (fn [uri pred data]
              {:type "create" :uri uri :predicate pred :value (uuid)})

  {:projector
   {:resource (fn [uri binding active url meta vals]
                (let [s (apply str vals)]
                  (hic/html [:li  {:class (if active "active" "")

                                   :data-uri uri}
                             [:a.projector-binding {
                                                    :href url
                                                    :data-uri uri
                                      :data-binding binding
                                      } (if (re-matches #"^\s*$" s) "untitled" s)]])))
    :value (fn [parent uri binding meta val]
             uri)
    :update nil
