fix bug and fix pattern not found in async