Updated CORS functions