fix non-exhaustive pattern-matching