             pdfView.go(to: pdfPage)
         }
         
-    }
-    
-    // call after moveToLastReadingProsess()
+        checkForNewerRecords()
+    }
+    
+    // call after moveToLastViewedPage()
     func checkForNewerRecords() {
         if let record = currentCKRecords?.first, let modificationDate = record["modificationDate"] as? Date, let cloudPageIndex = record["pageIndex"] as? NSNumber {
             if let currentModificationDate = currentEntity?.modificationDate {

                
                self.pdfView.document = document
                
                self.moveToLastReadingProsess()
                if self.pdfView.displayDirection == .vertical {
                    self.getScaleFactorForSizeToFit()
                }

    var managedObjectContext: NSManagedObjectContext? = nil
    var pageIndex: Int64 = 0
    var currentEntity: DocumentEntity? = nil
    var currentCKRecords: [CKRecord]? = nil
    
    // scaleFactorForSizeToFit
    var portraitScaleSingle: CGFloat = 0.0
