add a timeout to the XMLHttpRequest