fix for undefined window.location.origin in IE