adding logic to clear tasks'