Update heartbeat code