fixed connection to database, d3.js working