[#68247904] modified to return to the last item in the array if out of b...

...ounds thrown