Fixed Connection loss bug race condition