Added support for replica set