Added support for replication