fix error output filter in `which` command