Renamed the index in the getLength function to text.