Pass correct XHR object to window