fix NaN on first load