avoid NaNs at the beginning of data