fixed outOfBounds error using Integer