fixed infinite loop in async