Fix error in XHR handler when offline