check for d3 defined