fixed possible error where this.xhr is null or not an object