modified db.js