avoid unexpected exit by set -e