Dash live updates glitching on heroku

I have been trying to deploy my app on heroku and successfully did it. My app follows example given here for live updates every second. It works without any issues locally.

        interval=0.8*1000, # in milliseconds

I use a button to reset my graphs and the n_intervals using a callback. I was forcing n_interval=0 defining it as a global variable. The graph resets well enough locally. But on heroku it glitches. Two instances of the app runs parallel after pushing reset button. If i press reset 3 times, three different graphs keeps getting plotted (each one being plotted after 1 second of click).

I understand that this question sounds vague, But I can’t really put up the whole code to explain.