Added set -e to script to fail on error