updated cdn function