fixed awful NaN problem