check if parentNode in isVisible() function