fixed problem in parallel case