How to regain control of connection