smooths d3 graph, fixes error