fixed problem with out of bound string indices