Fixed ArrayIndexOutOfBoundException