fix issues with replication setup