new replicaset connection logic