Added synchronized to setClient(_,_)