added pipe detection