fixed indexing for swiping back and forth