Fix the index to create substring.