fix critical bugs in parallel