Add heartbeat mechanism