 
     (when-let [user-id (get-in ev-msg [:ring-req :session :user-id])]
       (if-let [dynamic-msg-handler (get @message-handlers id)]
-        (run-cofx! (dynamic-msg-handler (assoc ev-msg :user-id user-id)))
+        (run-cofx! ev-msg (dynamic-msg-handler (assoc ev-msg :user-id user-id)))
         (event-msg-handler (assoc ev-msg :user-id user-id))))))
 
 (defmethod event-msg-handler :default

   [braid.core.module-helpers :refer [defhook]]
   [braid.core.server.db :as db]
   [braid.core.server.socket :as socket]
   [mount.core :refer [defstate]]
   [schema.core :as s]
   [taoensso.sente :as sente]

  :initial-value {}
  :add-fn merge)

(defn run-cofx! [ev-msg cofx]
  (when-let [args (cofx :chsk-send!)]
    (apply socket/chsk-send! args))
  (when-let [txns (cofx :db-run-txns!)]
    (db/run-txns! txns))
  (when-let [[group info] (cofx :group-broadcast!)]
    (helpers/broadcast-group-change group info))
  (when-let [info (cofx :reply!)]
    (when-let [reply-fn (:?reply-fn ev-msg)]
      (reply-fn info))))

(defmulti event-msg-handler :id)

