Fixed bug in non-CORS logic