update MAIN.sh script