fix a matching bug found by dialyzer