update pattern matching