Fixed d3.js update method