Solve issue with NaN