update and fix bugs with parallel