     }
 
     func toggleDisplaySleep(sender: AnyObject?) {
-        if NSUserDefaults.standardUserDefaults().valueForKey("allowDisplaySleep") as Bool {
+        if assertion?.type == PowerAssertionType.PreventUserIdleSystemSleep {
             assertion?.type = PowerAssertionType.PreventUserIdleDisplaySleep
         } else {
             assertion?.type = PowerAssertionType.PreventUserIdleSystemSleep

        menu.addItem(NSMenuItem.separatorItem())
        menu.addItem(mItemAbout)
        menu.addItem(mItemQuit)
        
        // TODO: Find a nicer way to controll the Titles for the MenuItems
        // Maybe possible with Bindings/Transformations?
        if NSUserDefaults.standardUserDefaults().valueForKey("activateOnLaunch") as Bool {
            toggleMode(self)
        }
    }

    

     */
    override init() {
        // Setup 1st Assertion
        let starttype = NSUserDefaults.standardUserDefaults().valueForKey("allowDisplaySleep") as Bool ?
            PowerAssertionType.PreventUserIdleSystemSleep : PowerAssertionType.PreventUserIdleDisplaySleep
        
        assertion = PowerAssertion(name: "Barista Prevent Sleep", type: starttype, level: .Off)
        if assertion == nil {
            fatalError("Could not create assertion, abort!")
        }
