Attempting to fix parentNode for undefined issues