Add logic for tasks.