fix javascript error due to using latest D3.js