stuff for managing Xdomain requests