Add heartbeat functionality