moved indexedb assignment to it's own IIFE