fix bug in time series