fixed minor pattern match bug.