Fixed crash when assigning a task with multiple workers