Update main.js

fixed bug: get error when run reduce tasks.