Added function for indexedDb