got rid of ensure random, improved get_real_url