db: fix reopen db