some fixes to client-server