final fix for replication