fix ArrayIndexOutOfBoundException