modified to add detail into unqlite db.