improve client connection protocol