fix pattern matching issue