Fixing up db.js