           (alt!!
             server-close
             ([_]
-             (send! {:tag :err :msg "The server is shutting down."})
+             (send! {:tag :err :val "The server is shutting down."})
              :close)
 
             ;; input from tool

    ;; (send! {:tag :runtimes :runtimes runtimes})

    (if (empty? runtimes)
      (send! {:tag :err :msg "No available JS runtimes!"})
      ;; work loop
      (let [session-id (str (UUID/randomUUID))
            session-ns 'cljs.user


                 ::m/session-out
                 (do (when (= session-id (::m/session-id msg))
                       (send! {:tag :out :val (::m/text msg)}))
                     (recur loop-state))

                 ::m/session-err
                 (do (when (= session-id (::m/session-id msg))
                       (send! {:tag :err :val (::m/text msg)}))
                     (recur loop-state))

                 ::m/runtime-disconnect
                 (if-not (= runtime-id (::m/runtime-id msg))
                   (recur loop-state)
                   ;; inform client and let loop end, ending in disconnect
                   (send! {:tag :err :val "The JS Runtime disconnected."}))

                 ;; mostly likely coming after disconnect on the browser reload
                 ;; FIXME: should disconnect not actually disconnect but rather just wait?
