fix: flatten results to remove “undefined: undefined” errors