Changed the XHR to be a function level variable intead of a private class field