add replication heartbeat code