get rid of zero values in the end of time series