scope fixes for client connection