Change DEFAULT_ATTACHE_DIR to ATTACHE_DIR and add set -e flag.