changed to use db.js