use async.each instead of totalNum; #4