modify window.location test to be more well-defined