fixed the double xhr bug