parentNode needs a null check