changing this to window

this will not bind to the global object, so Queue wont work for the browser, window will fix this issue.