   ([show key]
    (end-function! show key false))
   ([show key force]
-   (let [effect (find-function show key)] 
-     (when (and effect
-                (or force (fx-util/end effect show (metro-snapshot (:metronome show)))))
-       (swap! (:active-functions show) #(remove-function-internal % (keyword key)))))))
+   (let [effect (find-function show key)
+         key (keyword key)] 
+     (if (and effect
+              (or force ((:ending @(:active-functions show)) key)
+                  (fx-util/end effect show (metro-snapshot (:metronome show)))))
+       (swap! (:active-functions show) #(remove-function-internal % key))
+       (swap! (:active-functions show) #(update-in % [:ending] conj key))))))
 
 (defn clear-functions!
   "Remove all effect functions from the active set, leading to a blackout state in all controlled

    :refresh-interval refresh-interval
    :universes (set universes)
    :next-id (atom 0)
    :active-functions (atom {})
    :variables (atom {})
    :fixtures (atom {})
    :task (atom nil)}))

    {:functions (vec-insert (:functions base) index f)
     :indices (insert-key (:indices base) key index)
     :keys (vec-insert (:keys base) index key)
     :priorities (vec-insert (:priorities base) index priority)
     :ending (:ending base)}))

(defn add-function!
  "Add an effect function or cue to the active set which are affecting
