task context cleanup