solve problem with NaN