Init logic for IndexedDb