Fixed ArrayOutOfBounds Exception