   (let [state-ref (ref {:members #{} :locks #{} :empherals #{}})
         conf2 (merge conf {:group-name group-name :heart-beat-freq heart-beat-freq})
         c (create-connection host conf)
-        connector {:conn c :state-ref state-ref :conf conf2 :host host :group-name group-name}]
+        member-event-ch (chan (sliding-buffer 10))
+        member-event-mult (mult member-event-ch)
+        connector {:conn c :state-ref state-ref :conf conf2 :host host :group-name group-name
+                   :member-event-ch member-event-ch :member-event-mult member-event-mult}
     
-    (fixdelay (* heart-beat-freq 1000) 
-              (dosync 
-                (alter state-ref (partial heart-beat connector))))
-     connector)))
+		    heart-beat-ch (fixdelay (* heart-beat-freq 1000) 
+								              (dosync 
+								                (alter state-ref (partial heart-beat connector))))]
+      (assoc connector :heart-beat-ch heart-beat-ch))))
         
         


(defn get-members [{:keys [conn] :as connector}]
  (map (fn [path]
         {:path path :val (System/currentTimeMillis)})
       (car/wcar conn
            (car/keys (clojure.string/join [(members-path connector) "/*"])))))


(defn join 
  ([connector]
    (join connector host-name))
  ([{:keys [conn conf state-ref] :as connector} node-name]
    (let [{:keys [heart-beat-freq]} conf
          path (members-path connector node-name)
          val (System/currentTimeMillis)]

  (clojure.string/join ["/" (clojure.string/join "/" (flatten [group-name "locks" path]))]))


(defn close [{:keys [state-ref member-event-ch heart-beat-ch]}]
  ;delete connection's state
  (close! heart-beat-ch)
  (close! member-event-ch)
  
  (dosync (alter state-ref (fn [state] {}))))
                        
(defn create-connection 
