fixed stat calculation bug