fixing task distribution bugs