Fixed heroku crash -- global variable not defined