Fixing the d3 error