Fix task invalidation