improved connection management