When something goes wrong inside preprocess.sh, the script will still return exit code 0 and main will continue running making it a bit more difficult to diagnose problem. I recommend adding the following at the top of every bash script.
set -e makes sure that script will exist as soon as something goes wrong, and set -x echos out all command executed in the script to help diagnose problems.