improved update.sh