fixing d3 bug