added constructor on db.