added support for replica set