fixed stat generation bug