adding console.log to check value of d.parent