 	//This is unecessary since the server will definitely be started by the time the page is loaded
 //	var reloadTimer = Timer()
 	var stopTimer = Timer()
+	var utilTimer = Timer()
 	
 	override func viewDidLoad() {
 		NSLog("Document View Controller viewDidLoad")

		
		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.")
							}
						})
					}
				}
			}
