prepare client connection