make sure we are in the page before locating parentNode