fix: duplicated db open; db close added