                 (do (println "quit") (.close listener))
 
                 :else
-                (do (and listener (>! ch (.accept listener)))
+                (do (and listener (>! ch listener))
                     (recur backends listener config))))))
     shutdown))

  "a channel that accepts nio SocketChannels and relays the data being sent to them onto a new connection to host:port"
  [host port]
  (let [ch (chan)]
    (go
      (loop []
        (let [socketchannel (<! ch)]
          (when socketchannel
            (when (instance? SocketChannel socketchannel)
              (relay-to-backend socketchannel host port)

             config {}]
        (let [[val ch] (alts!
                        (conj
                         (map #(vector (:chan %) listener) backends)
                         config-ch
                         shutdown))]
          (cond (= ch config-ch)
