implement add_task method