fixing NaN error in test