enabled the handling of replica_set
added retry during replica set failure to wait for failover