Update multi-threading in main.sh