                       scf-store/replace-catalog!
                       (fn [& args]
                         (.countDown latch)
+                        (.await latch)
                         (apply orig-replace-catalog! args))]
           (let [first-message? (atom false)
                 fut (future

                      scf-store/replace-catalog!
                      (fn [& args]
                        (.countDown latch)
                        (apply orig-replace-catalog! args))]
          (let [first-message? (atom false)
                second-message? (atom false)

                      scf-store/update-facts!
                      (fn [fact-data]
                        (.countDown latch)
                        (.await latch)
                        (storage-replace-facts! fact-data))]
          (let [first-message? (atom false)
                second-message? (atom false)
