clean up output and fix no match check