Fix bug with endless loop in xml download