Fixed indexedDB storage for saving files (was only working for the first file).