fix training flow