 		        (do
                ;if master and all the nodes have written to the sync point, write the new assignments and set the partition flag to nil
                (if (is-master!? connector host topic)
-                 (if (>= (count (empheral-ls connector (sync-point-path-keys connector topic))) (count (get-remote-members connector)))
-                   (let [members (get-member-keys connector)]
+                 (if (>= (count (empheral-ls connector (sync-point-path-keys connector topic))) (count (get-partition-members connector topic)))
+                   (let [members (get-member-keys connector topic)]
                      ;delete all keys in sync path
                      (doseq [ks (empheral-ls connector (sync-point-path-keys connector topic))]
                        (empheral-del connector (:path ks)))
                      ;set the assignments and un set the partition flag
                      (empheral-set connector (assignments-path topic) (distribute-ids members ids))
                      (empheral-del connector (partition-flag-path topic)))
-                   (info  "sync keys " (empheral-ls connector (sync-point-path-keys connector topic)) " members " (map :path (get-remote-members connector))))
+                   (prn  "sync keys " (empheral-ls connector (sync-point-path-keys connector topic)) " members " (map :path (get-partition-members connector topic))))
                  )
                
                (if (is-partition-flag? connector topic)

  (str topic "/sync-point/*"))


(defn- get-member-keys [connector]
  (map #(-> (clojure.string/split % #"/") last) (map :path (get-remote-members connector))))

(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)))
      (empheral-set connector (partition-flag-path topic) true)))

(defn- wait-on-partition-flag! 

      ;(prn ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> set syncpoint path " (sync-point-path connector host topic) )
      (empheral-set connector (sync-point-path connector host topic) nil)
      ;run join because the host must be a meber for the algorithm to work
      
      ;loop in partition flag, only the master can unset the partition flag      
		  (loop [c 0]
