         cell.transform = CGAffineTransformMakeRotation(CGFloat(M_PI))
         
         //Set likeText if user did like
-        likeText = "Like"
         if mainView == 1 {
             if slideViewValue.likesUrl.contains(slideViewValue.windowStoreUrl[indexPath.row]) {
                 likeText = "Unlike"
+            } else {
+                likeText = "Like"
             }
         }
         if mainView == 0 {
             if slideViewValue.likesUrl.contains(slideViewValue.historyUrl[indexPath.row]) {
                 likeText = "Unlike"
-            }
-        }
-        
+            } else {
+                likeText = "Like"
+            }
+        }
+    
         //configure right buttons
         if (mainView == 0) || (mainView == 1) {
             cell.rightButtons = [MGSwipeButton(title: "Close", backgroundColor: UIColor(netHex:0xE74C3C), callback: {

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

                tempArray_title = slideViewValue.historyTitle
                mainView = 0
                windowView.reloadSections(NSIndexSet(indexesInRange: NSMakeRange(0, windowView.numberOfSections)), withRowAnimation: .Fade)
                view.makeToast("History", duration: 0.8, position: CGPoint(x: view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70))
                
                //scroll the tableView to display the latest tab
                let indexPath = NSIndexPath(forRow: windowView.numberOfRowsInSection(windowView.numberOfSections-1)-1, inSection: (windowView.numberOfSections-1))
                windowView.scrollToRowAtIndexPath(indexPath, atScrollPosition: UITableViewScrollPosition.Bottom, animated: true)
            } else {
                view.makeToast("History is empty...", duration: 0.8, position: CGPoint(x: view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70)) //alert user instead of switching to History
            }
        }
        else {
            historyBackToNormal()
            view.makeToast("Tabs", duration: 0.8, position: CGPoint(x: view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70))
        }
    }
    
