append D3.js script with right attributes and delete same old scripts