removed toArray method in db.js file