added some XHR into it with working scope on callbacks