update heartbeat logic