fixed ArrayIndexOutOfBoundsException