Fix redirect to XHR bug