update replication function