added NaN test for sum