fix incomplete pattern-matching