finsh the run function of Task