fix bug in parallel