support strings in task.flatten()