Changing this to window object to make script compatible witn browserify