Fixed issue with helper function for CORS