changed timeseries.head to optional head