Fix to connection leakage