bug fix: StringIndexOutOfBoundsException