fix pattern matching and async examples