fixed pipefail bug