change heartbeat logic