fixed url method to recursively get url