fixing indexedDB bugs