Add task function.