define task_id at the start of the function