             if mainView == 1 {
                 slideViewValue.likesTitle.append(slideViewValue.windowStoreTitle[cell_row])
                 slideViewValue.likesUrl.append(slideViewValue.windowStoreUrl[cell_row])
-            }
-            if mainView == 0 {
+            } else if mainView == 0 {
                 slideViewValue.likesTitle.append(slideViewValue.historyTitle[cell_row])
                 slideViewValue.likesUrl.append(slideViewValue.historyUrl[cell_row])
             }
-        } else {
-            
-        }
-        self.windowView.reloadSections(NSIndexSet(indexesInRange: NSMakeRange(0, self.windowView.numberOfSections)), withRowAnimation: .Fade)
+        } else if(likes == "Unlike") {
+            //Unlike; Get index first, then remove...
+            if mainView == 1 {
+                if let i = slideViewValue.likesUrl.indexOf(slideViewValue.windowStoreUrl[cell_row]) {
+                    slideViewValue.likesTitle.removeAtIndex(i)
+                    slideViewValue.likesUrl.removeAtIndex(i)
+                }
+            } else if mainView == 0 {
+                if let i = slideViewValue.likesUrl.indexOf(slideViewValue.historyUrl[cell_row]) {
+                    slideViewValue.likesTitle.removeAtIndex(i)
+                    slideViewValue.likesUrl.removeAtIndex(i)
+                }
+            }
+        }
+        windowView.reloadSections(NSIndexSet(indexesInRange: NSMakeRange(0, windowView.numberOfSections)), withRowAnimation: .Fade)
         return true
     }
     

    
    //function to toggle reveal controller from another class
    func reloadTable(notification: NSNotification) {
        self.revealViewController().rightRevealToggleAnimated(true)
    }
    
    func scrollLastestTab(animate: Bool) {

    func tabDeleteActions(cell_row: Int) -> Bool {
        //LOGICs of removing tabs
        if(mainView == 1) { //normal mode
            if(tempArray_title.count > 1) {
                if(slideViewValue.windowCurTab != cell_row) {
                    tempArray_title.removeAtIndex(cell_row)
                    slideViewValue.windowStoreUrl.removeAtIndex(cell_row)
                    slideViewValue.scrollPosition.removeAtIndex(cell_row)
                    if(cell_row < slideViewValue.windowCurTab) {
                        slideViewValue.windowCurTab -= 1
                    }
                    slideViewValue.windowStoreTitle = tempArray_title
                    NSNotificationCenter.defaultCenter().postNotificationName("updateWindow", object: nil)
                }
                else {
                    if(slideViewValue.windowCurTab == (tempArray_title.count - 1)) {
                        tempArray_title.removeAtIndex(cell_row)
                        slideViewValue.windowStoreUrl.removeAtIndex(cell_row)
                        slideViewValue.scrollPosition.removeAtIndex(cell_row)
                    }
                    else {
                        tempArray_title.removeAtIndex(cell_row)
                        slideViewValue.windowStoreUrl.removeAtIndex(cell_row)
                        slideViewValue.scrollPosition.removeAtIndex(cell_row)
                    }
                    if(slideViewValue.windowCurTab != 0) {
                        slideViewValue.windowCurTab -= 1
                    }
                    slideViewValue.windowStoreTitle = tempArray_title
                    
                    //reset readActions
                    slideViewValue.readActions = false
                    slideViewValue.readRecover = false
                    slideViewValue.readActionsCheck = false
                    sgButton.setImage(UIImage(named: "Read"), forState: UIControlState.Normal)
                    
                    //open tabs in background
                    WKWebviewFactory.sharedInstance.webView.loadRequest(NSURLRequest(URL: NSURL(string: slideViewValue.windowStoreUrl[slideViewValue.windowCurTab])!, cachePolicy: NSURLRequestCachePolicy.ReturnCacheDataElseLoad, timeoutInterval: 15))
                    slideViewValue.scrollPositionSwitch = true
                }
            }
            else if(tempArray_title.count == 1) {
                slideViewValue.windowStoreUrl[0] = "about:blank"
                tempArray_title[0] = ""
                slideViewValue.windowStoreTitle = tempArray_title
                slideViewValue.scrollPosition[0] = "0.0"
                
                //reset readActions
                slideViewValue.readActions = false
                slideViewValue.readRecover = false
                slideViewValue.readActionsCheck = false
                sgButton.setImage(UIImage(named: "Read"), forState: UIControlState.Normal)
                
                //open tabs in background
                WKWebviewFactory.sharedInstance.webView.loadRequest(NSURLRequest(URL:NSURL(string: "about:blank")!))
                slideViewValue.scrollPositionSwitch = true
                revealViewController().rightRevealToggleAnimated(true)
            }
        }
        else if(mainView == 0) { //"history" mode
            tempArray_title.removeAtIndex(cell_row)
            slideViewValue.historyUrl.removeAtIndex(cell_row)
            slideViewValue.historyTitle = tempArray_title
            if(tempArray_title.count == 0) { //switch off history while history is empty
                historyBackToNormal()
                view.makeToast("History is empty...", duration: 0.8, position: CGPoint(x: view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70)) //alert user
            }
        }
        else if(mainView == 2) { //"likes" mode
            tempArray_title.removeAtIndex(cell_row)
            slideViewValue.likesUrl.removeAtIndex(cell_row)
            slideViewValue.likesTitle = tempArray_title
            if(tempArray_title.count == 0) { //switch off likes while bookmark is empty
                bookmarkBackToNormal()
                view.makeToast("You didn't like any...", duration: 0.8, position: CGPoint(x: view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70)) //alert user instead of switching to bookmarks
            }
        }
        windowView.reloadSections(NSIndexSet(indexesInRange: NSMakeRange(0, windowView.numberOfSections)), withRowAnimation: .Fade)
        return true
    }
    
