fix bug to remove duplicate hosts in replica set