Fix for window.location.origin in IE