fix for while loop of xml parse