made xhrRequest more synchronous