make some changes to d3 directive