better fix for nightly.sh bug