fixed bugs, including omp fail