add x-domain error handling