more thorough fix for all usages of grep