fix task invalidate method