Fix global variable assignment bug, fixes CORS