bug fix NaN after learning