fixed bug when not all workers are used