Fix ArrayOutOfBoundException