added callback mechanism to replication