         (println "Waiting for kill signal...")
         (while (not= 0 (<!! (:in lead)))
           (<!! (timeout 50)))
-        (.close (:socket lead))
+        (do (a/close! (:in lead))
+            (a/close! (:out lead)))
         (println "Done!")))))
 
 (defn -main

    (do
      (>!! send-chan 0)
      (reset! (:running server) false)
      (.close (:server-socket server)))
    (println "Sieve completed!")))


                  (recur))
                (.close sock)))))))
    (go-loop []
      (if-not running?
        (.close server-socket)
        (recur)))
    {:server-socket server-socket
     :running running?
     :connected connected}))
