fix the mapreduce to support multithread