Need help with Twitch TV app

I got completed with the app, but in the resultant values, getting some duplicate entries as well for some stream users, please help with the issue.

You have duplicates because you’re using global vars and not clearing them.

Thanks a lot its working fine now.