bug fix for NaN value in stat