modified codes before torque tasks