So, my comment doesn't get lost in an "outdated diff", I'll say it here again: this var declaration needs to be moved to top of module.