updated for external mongmongodb replica set