         
         //in app purchases have arrived so refresh the collection view
         collectionView.reloadData()
+        self.collectionView.collectionViewLayout.invalidateLayout()
     }
     
     

            fatalError("Found unexpected item type in Perk store: \(currentItem)")
        }
        
        
        
        
        
        
        return cell
    }

    override func collectionView(_ collectionView: UICollectionView,
                                 layout collectionViewLayout: UICollectionViewLayout,
                                 sizeForItemAt indexPath: IndexPath) -> CGSize {
        //self.collectionView.collectionViewLayout.invalidateLayout()
        
        let width = storeCollectionView.bounds.size.width / 2 - 5
        let height = width
        return CGSize(width: CGFloat(width), height: CGFloat(height))
