small changes to XHR loading