added some old code to try and fix crossdomain issues