                 slideViewValue.bkButtonSwitch = false
                 bgText.text = "history"
                 tempArray_title = slideViewValue.historyTitle
-                mainView = false
+                mainView = 0
                 windowView.reloadSections(NSIndexSet(indexesInRange: NSMakeRange(0, windowView.numberOfSections)), withRowAnimation: .Automatic)
                 self.view.makeToast("History", duration: 0.8, position: CGPoint(x: self.view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70))
                 

    }
    var tempArray_title = [String]() //Temporary store array
    var style = ToastStyle() //initialise toast
    var mainView: Bool = false
    var trashButton: Bool = false
    var likeText: String = ""
    

            })
            if(slideViewValue.likesTitle.count > 0) { //avoid size < 0 bug crash
                bkButton.setImage(UIImage(named: "Bookmark-filled"), forState: UIControlState.Normal)
                slideViewValue.bkButtonSwitch = true
                htButton.setImage(UIImage(named: "History"), forState: UIControlState.Normal)
                slideViewValue.htButtonSwitch = false
                bgText.text = "likes"
                tempArray_title = slideViewValue.likesTitle
                mainView = 2
                windowView.reloadSections(NSIndexSet(indexesInRange: NSMakeRange(0, windowView.numberOfSections)), withRowAnimation: .Automatic)
                self.view.makeToast("Likes", duration: 0.8, position: CGPoint(x: self.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 {
                self.view.makeToast("You didn't like any...", duration: 0.8, position: CGPoint(x: self.view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70)) //alert user instead of switching to History
            }
        }
        else {
            bookmarkBackToNormal()
            self.view.makeToast("Tabs", duration: 0.8, position: CGPoint(x: self.view.frame.size.width-120, y: UIScreen.mainScreen().bounds.height-70))
        }
    }
    
    func bookmarkBackToNormal() { //switch Bookmark feature off
        bkButton.setImage(UIImage(named: "Bookmark"), forState: UIControlState.Normal)
        UIView.animateWithDuration(0.2, delay: 0.0, options: UIViewAnimationOptions.CurveEaseIn, animations: {
            self.navBar.frame.origin.x = -55
            }, completion: { finished in
        })
        slideViewValue.bkButtonSwitch = false
        bgText.text = "maccha"
        tempArray_title = slideViewValue.windowStoreTitle
        mainView = 1
        windowView.reloadSections(NSIndexSet(indexesInRange: NSMakeRange(0, windowView.numberOfSections)), withRowAnimation: .Automatic)
        scrollLastestTab(true)
    }
    
    func settingsAction() {
