         print(">>> finish loading")
         
         
-        isOnManagePage = webView.url!.absoluteString.hasPrefix(Constants.greenGoblinURLprefix) && webView.url!.absoluteString.hasSuffix(Constants.greenGoblinURLsuffix)
+        let isURLPrefixManagePagePrefix = webView.url!.absoluteString.hasPrefix(Constants.greenGoblinURLprefix)
+        let isURLSuffixManagePagePrefix = webView.url!.absoluteString.hasSuffix(Constants.greenGoblinURLsuffix)
+        isOnManagePage = isURLPrefixManagePagePrefix && isURLSuffixManagePagePrefix
         
         // FIXME: Parse HTML by tags
         /**

         
         */


        webView.evaluateJavaScript("document.documentElement.outerHTML") {
            (html: Any?, error: Error?) in
            if let doc = html as? String {
                if doc.contains(Constants.aPlusLogInURLPath) {
                    print(">>> Should log in")
                    self.vibratePhone()
                } else {
                    print(">>> logged in")
                    if let url = webView.url {
                        print("    >>> logged in @ \(url.absoluteString)")
                        if url.absoluteString == Constants.aPlusURL {
                            webView.load(URLRequest(url: URL(string: "https://plus.cs.hut.fi/a1141/2016/lti-login/78/")!))
                        }
                    }
                    
                }
            }
        }
    }
    
    func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {

    
    func isNotStudentInQueue(name: String, time: String) -> Bool {
        let studentsWithSameName = students.filter { $0.name == name }
        guard let _ = studentsWithSameName.first else {
            return true  // Because we don't want to add it to the queue
        }
        return studentsWithSameName.filter { existing in
