check if a connection already exists before getting a new one