 -----------------------------------------------------------"
 (defn  add-data-query-watch-v2 [ query-key ]
 
-  (let [  data-query-atom       (get @client-query-cache  query-key)
-          list-of-views-atom    (get @data-query-atom  :list-of-data-window-keys)       ]
-
-
-    ; this says that whenever the list of views changes then update all of the views. This
-    ; is a bit much, as really only the added views need to be updated
-    (add-watch list-of-views-atom
-               (merge query-key {:type "views"})
+  (let [  data-query-atom              (get @client-query-cache  query-key)
+          list-of-data-windows-atom    (get @data-query-atom  :list-of-data-window-keys)
+          name-of-watch                (merge query-key {:type "views"})
+          ]
+
+
+    ; this says that whenever the list of data windows changes then update all of the
+    ; data windows. This is a bit much, as really only the added data windows need to be updated
+    (add-watch list-of-data-windows-atom
+               name-of-watch
                (fn [_ _ old-val new-val]
                  ;(js/alert (pr-str "new view: " new-val))
-                 (update-all-views-for-query   query-key)
-                 ))
+                 (update-all-data-windows-for-query   query-key)))
+
+
+
 
     ; this says that whenever the query information changes then see if
     ; we need to get any more information from the database

                         (for [ query-key    queries ]
                           (let [query (get  @client-query-cache  query-key)]
                             (swap! query assoc :updated (.getTime (js/Date.)))
                             (update-all-views-for-query  query-key)
                             )))))))

      )

                              )))
                       )

                       (update-all-data-windows-for-query   query-key)

                       ))

