Added setTimeout for XMLHttpRequest