   (str topic "/sync-point/*"))
 
 
-(defn- get-member-keys [connector]
-  (map #(-> (clojure.string/split % #"/") last) (map :path (get-remote-members connector))))
+(defn- get-member-keys [connector topic]
+  (map #(-> (clojure.string/split % #"/") last)  (get-partition-members connector topic)))
 
 (defn- perform-assignments! 
   "Read the members, sets the partition flag to true, sets the assignemnts from distribute-ids and finally sets the partition flag to nil"
   [connector host topic ids]
-  (join connector host)
   ;(prn "perform-assignments is-flag " (empheral-get connector (partition-flag-path topic)) " - d1 "   (empheral-get connector (assignments-path topic))
    ; " d2 " (distribute-ids (get-member-keys connector) ids)  " ids " ids " members " (get-member-keys connector))
   (if (and ;only perform assignments if the partion flat is false and the calculated assignment differs from the saved one
         (not (empheral-get connector (partition-flag-path topic)))
-        (not= (empheral-get connector (assignments-path topic)) (distribute-ids (get-member-keys connector) ids)))
+        (not= (empheral-get connector (assignments-path topic)) (distribute-ids (get-member-keys connector topic) ids)))
       (empheral-set connector (partition-flag-path topic) true)))
 
 (defn- wait-on-partition-flag! 

     (apply hash-map (interleave  (set members) (partition-all d (set ids)))))))


(defn- is-master!? 
  "Get a lock on $topic/master if the lock is not attained it means this host is not the master"
  [connector host topic]

  ([connector host topic ids]
     ;identify master
    ;(prn "is-master!? " host  " " (is-master!? connector host topic))
    (empheral-set connector (str topic "/partition-members/" host) (System/currentTimeMillis))
     
    (if (is-master!? connector host topic) ;here the master sets the assignment flag (sync barrier) only if needed
      (perform-assignments! connector host-name topic ids))
    
