modify training logic