fixes to flash.sh