remove db.open and db.close calls