changed random number so it only uses a range based on the number of items returned by the JSON query