fixes to make multiple clients works