change to make global variable into a local one. (not tested)

I was given a jira to make this specific chance. Might want to test it to make sure it doesn't blow up the website before having it go live.