added sleep to allow time for pipe to settle