 			print("open handler suc: \(suc)")
 			if suc {
 				self.document = doc
-			}
-			
-			if let comp = completion {
-				comp(suc)
-			}
+				if let comp = completion {
+					comp(suc)
+				}
+			}
+//			else {
+//				//Wait a bit and try once more
+//				//TODO: make each document create and destroy its own temp directory so a document
+//				Thread.sleep(forTimeInterval: 0.3)
+//				doc.open(completionHandler: { (suc2) in
+//					if suc2 {
+//						self.document = doc
+//					}
+//					if let comp = completion {
+//						comp(suc2)
+//					}
+//				})
+//			}
+			
+			//Uncomment (see above)
+//			if let comp = completion {
+//				comp(suc)
+//			}
 		})
 		
 		return true

		
		self.server["/data/open"] = { (request: HttpRequest) -> HttpResponse in
			let queries = BBTSequentialQueryArrayToDict(request.queryParams)
			
			guard let name = queries["filename"] else {
				return .badRequest(.text("Missing Parameters"))

			}
			
			if self.document.documentState == .closed {
				print("Running open block now!")
				openBlock()
			} else {
				if #available(iOS 10.0, *) {
					DispatchQueue.main.sync {
						self.utilTimer = Timer.scheduledTimer(withTimeInterval: 0.75,
						                                      repeats: false,
						                                      block: { t in
							if self.document.documentState == .closed {
								openBlock()
							} else {
								NSLog("Unable to open file.")
							}
						})
					}
				}
			}
