fixed a bug where I was checking for global variable existence without prefixing it with "window."