added (count) to random_ids so it returns the correct number of ids