some fix for replication