NaN issue resolved