fixing weird NaN thing