set -e is redundant since trap ERR would take care of errors