fix some bugs in async