Fixed a bug in parallel