Update to support replica sets