fixing task distributing bug