--- title: Auto-subscriptions --- The app in the previous example works, but there's a subtle bug — the store is subscribed to, but never unsubscribed. If the component was instantiated and destroyed many times, this would result in a *memory leak*. Start by declaring `unsubscribe` in `App.svelte`: ```js const unsubscribe = count.subscribe(value => { count_value = value; }); ``` You now declared `unsubscribe`, but it still needs be to called, for example through the `onDestroy` [lifecycle hook](tutorial/ondestroy): ```html