The problem is that if a recurring string of index is 1-9 everything is fine. If the string repeats to the end of the list, the result is always one.