add -e option to exit with an error on error