move db.init to reset function