     ; update the record IDs in the query
     ; -----------------------------------------------
     (if query-atom
-      (reset!  query-atom
-               (assoc @query-atom :values
-                 (merge
-                  (apply merge (map
-                                (fn[record-pos
-                                    record-id]   {record-pos  record-id})
-
-                                list-of-record-positions
-                                records
-                                ))
-                  (get @query-atom :values)))))
+      (do
+        (reset!  query-atom
+                 (assoc @query-atom :values
+                   (merge
+                    (apply merge (map
+                                  (fn[record-pos
+                                      record-id]   {record-pos  record-id})
+
+                                  list-of-record-positions
+                                  records
+                                  ))
+                    (get @query-atom :values))))))
 
 
     ; -----------------------------------------------

         xx           (-> x :queries keys first)
         ;new-key     (dissoc (dissoc xx :start) :end)
         new-key      {:data-source     :todo_items
                       :table           "todo_items"
                       :where           nil
                       :db-table        "todo_items"
                       :params          nil
                       :order           nil
                       :realtime        true}
         ]
     (log "Client realtime: " new-key)
     (>! client-query-cache-requests  {
                                  :query-key     new-key


                           (if (not already-loaded?)
                             (go
                              ;(js/alert (str "Query loaded?" already-loaded?))
                              ;(log (pr-str " ********* query values:" (get @new-query-atom :values)))
                              (>! client-query-cache-requests  {
                                                           :query-key     query-key

