BUG FIX: StringIndexOutOfBoundsException fixed