trying to fix OutOfBoundsException