adds task with invoke method