 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Application
 (defonce messages-receive-chan (atom nil))
-(defonce messages-send-chan (atom (chan)))
+(defonce messages-send-chan (atom nil))
 
 (defn start-message-loop [messages-receive-chan]
   (go-loop []

      (message-dispatch msg @messages-send-chan)
      (recur))))

(go (while true
      (let [msg (<! @messages-send-chan)]
        (swap! message-send-log conj msg)
        (chsk-send! (:id msg) (:message msg)))))

(defn stop! []
  (do
    (close! @messages-receive-chan)
    (stop-http-server!)
    (stop-router!)))


  (do
    (reset! messages-receive-chan (chan))
    (start-message-loop @messages-receive-chan)
    (reset! messages-send-chan (chan))
    (start-message-send-loop @messages-send-chan)
    (start-http-server!)
    (start-router! @messages-receive-chan)))

(defn restart! []
  (stop!)
  (start!))

(defn -main
  [& args]
