fixed cyclic data indexing