 
 (defn check-for-serious-error []
   (when (.. MMStudioMainFrame seriousErrorReported_ get)
-    (swap! state :stop true)))
+    (swap! state assoc :stop true)))
 
 ;; time
 

  (merge
    (map-config (core getSystemStateCache))
    (:metadata event)
    (let [[x y] (let [xy-stage (state :default-xy-stage)]
                  (when-not (empty? xy-stage)
                    (get-in state [:last-stage-positions xy-stage])))]

       "PixelSizeUm" (state :pixel-size-um)
       "PixelType" (state :pixel-type)
       "PositionIndex" (:position-index event)
       "PositionName" (when-lets [pos (:position-index event)
                                  msp (get-msp pos)]
                                 (.getLabel msp))
       "Slice" (:slice-index event)
       "SliceIndex" (:slice-index event)
       "SlicePosition" (:slice event)
