Fixed changing of new leader and heartbeat
merged replica