task id check, cleanup