out of bounds error on random