merge gilad's client code