added CORS compatibility