fix issues with cors/x-domain requests