Fix bug that make incorrect training data