Update run_task method