fixes in replication