fixed a logic bug in pattern matching