     
     override public func viewDidLoad() {
         super.viewDidLoad()
-        collectionView!.register(PDFPageCollectionViewCell.self, forCellWithReuseIdentifier: "page")
+        collectionView?.register(PDFPageCollectionViewCell.self, forCellWithReuseIdentifier: "page")
         
         if actionButton == nil {
             if let actionButtonImage = actionButtonImage {

    }
    
    public override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
        coordinator.animate(alongsideTransition: { (context) in
            let currentIndexPath = IndexPath(row: self.currentPageIndex, section: 0)
            self.collectionView.reloadItems(at: [currentIndexPath])
            self.collectionView.scrollToItem(at: currentIndexPath, at: .centeredHorizontally, animated: false)
            }) { (context) in
                self.thumbnailCollectionController?.currentPageIndex = self.currentPageIndex
        }
        

    
    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
        let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "page", for: indexPath) as! PDFPageCollectionViewCell
        cell.setup(indexPath.row, collectionViewBounds: collectionView.bounds, document: document, pageCollectionViewCellDelegate: self)
        return cell
    }
}
