added the "set -o pipefail" to the bash script