added new support for replication