fix: use clearmatches only if available