update the task context  after reading every line