              (recall-z-reference current-position))
           #(when-let [wait-time-ms (:wait-time-ms event)]
              (acq-sleep wait-time-ms))
-          #(when (:autofocus event)
+          #(when (get event :autofocus)
              (run-autofocus))
           #(when check-z-ref
              (store-z-reference current-position))

		cache (doto (MMImageCache. (TaggedImageStorageRam. summary-metadata))
						(.setSummaryMetadata summary-metadata))]
		(doto (VirtualAcquisitionDisplay. cache nil)
                           (.promptToSave false)
                            (.setChannelDisplayRange 0 0 256)
                            (.setChannelDisplayRange 1 0 256) 
                            (.setChannelDisplayRange 2 0 256))))

(defn create-basic-event []
  {:position-index 0, :position nil,

                (swap! state assoc
                       :burst-time-offset (- (elapsed-time @state)
                                             (core-time-from-tags (image :tags)))))
              ;(println (image+ :tags))
              (.put out-queue (make-TaggedImage (annotate-image image+ evt @state
                                                                (burst-time (:tags image) @state)))))
            (when (core isBufferOverflowed)
              (swap! state assoc :stop true)
              (ReportingUtils/showError "Circular buffer overflowed."))))
        (flatten (map make-multicamera-events (event :burst-data))))))
  (while (and (not (@state :stop)) (. mmc isSequenceRunning))
    (Thread/sleep 5)))

(defn collect-snap-image [event out-queue]
  (let [image
        {:pix (core getImage)
         :tags nil}]
    (select-keys event [:position-index :frame-index
                        :slice-index :channel-index])
    (when out-queue
      (.put out-queue
            (make-TaggedImage (annotate-image image event @state (elapsed-time @state)))))
    image))

(defn return-config []
  (dorun (map set-property
