run tasks on begin