fix errors in source code for parallel