Bug fix for console.log error caused by childNodes