Under certain circumstances location.href is not defined in IE8. Which sometimes causes an infinite routing loop