       )))
 
 (defn cleanup []
+  (try
   (log "cleanup")
  ; (do-when #(.update %) (:display @state))
   (state-assoc! :finished true :display nil)


(defn collect [event out-queue]
  (condp = (:task event)
                :snap (collect-snap-image event out-queue)
                :burst (collect-burst-images event out-queue)))

(defn z-in-msp [msp z-drive]

  (when (and (@state :init-continuous-focus)
             (not (core isContinuousFocusEnabled)))
    (core enableContinuousFocus true))
  (return-config)
    (catch Throwable t (ReportingUtils/showError t "Acquisition cleanup failed."))))

;; running events
  
