fix StringIndexOutOfBounds