             realm.beginWriteTransaction()
             realm.deleteAllObjects()
             realm.commitWriteTransaction()
-        }
-        
-         UserAuthHelper.clearUser() //clear nsuserdefaults so user is forced to login everytime the user opens the app
+            
+        }
+        
+        UserAuthHelper.clearUser() //clear nsuserdefaults so user is forced to login everytime the user opens the app
         
         //white status bar
         UIApplication.sharedApplication().statusBarStyle = .LightContent

        let gai = GAI.sharedInstance()
        gai.trackUncaughtExceptions = true  // report uncaught exceptions
        gai.logger.logLevel = GAILogLevel.Verbose  // remove before app release

        
        return true
    }
    
    
    /**
    This method sets up MQA. If isDevelopment is set to true in info.plist, MQA isn't set up, else it is.
    */
    private func setUpMQA(){
        if(Utils.isDevelopment() != true){
        let configurationPath = NSBundle.mainBundle().pathForResource("Config", ofType: "plist")
        var mqaApplicationKey : String = ""
        
        var hasValidConfiguation = true
        
        if((configurationPath) != nil) {
            let configuration = NSDictionary(contentsOfFile: configurationPath!)!
            
            mqaApplicationKey = configuration["mqaApplicationKey"] as! String
            if(mqaApplicationKey == ""){
                hasValidConfiguation = false
                _ = "Open the Config.plist file and set the mqaId to the MQA application key"
            }
        }
        if(hasValidConfiguation){
            
            MQALogger.startNewSessionWithApplicationKey(mqaApplicationKey)
            
            NSSetUncaughtExceptionHandler(exceptionHandlerPointer)
        }else{
            NSException().raise()
        }
        }
    }
    

    }
    
    /**
     This method registers the challenge handler needed for worklight when a user times out
     */
    private func registerChallengeHander(){
        let challengeHandler = ReadyAppsChallengeHandler()
        WLClient.sharedInstance().registerChallengeHandler(challengeHandler)
