Fix bug in createXMLHttpRequest