fixed NaN issue