changed so only pipe once