     (when (and (or (not (core isContinuousFocusEnabled))
                    (core isContinuousFocusDrive z-drive)))
       (let [z (get-z-stage-position z-drive)]
-        (set-msp-z-position current-position z-drive z)
         (state-assoc! :reference-z z)))))
 
 ;; startup and shutdown

              0))
         z-ref))))

(defn recall-z-reference [current-position]
  (let [z-drive (@state :default-z-drive)]
    (when (and (or (not (core isContinuousFocusEnabled))
                   (core isContinuousFocusDrive z-drive)))
      (set-z-stage-position z-drive
        (or (get-msp-z-position current-position z-drive)
            (@state :reference-z))))))

             (run-autofocus))
          #(when check-z-ref
             (store-z-reference current-position))
          #(update-z-positions current-position)
          #(when z-drive
             (let [z (compute-z-position event)]
               (set-stage-position z-drive z)))
