         
         self.commandDelegate!.runInBackground({
             
-            guard let logLevel =  IMFLogLevel(rawValue: command.arguments[0] as! Int) else {
-                
+            guard let levelString =  command.arguments[0] as? String else {
+                let message = "LogLevel Parameter is Invalid."
+                let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)
+                // call error callback
+                self.commandDelegate!.sendPluginResult(pluginResult, callbackId:command.callbackId)
+                return
+            }
+            
+            // covert inputLevel to the enum type
+            guard let logLevel : IMFLogLevel = self.logLevelDictionary[levelString] else
+            {
                 let message = "LogLevel Parameter is Invalid."
                 let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)
                 // call error callback

    
    func setCapture(command: CDVInvokedUrlCommand){
        
        guard let enabled  = command.arguments[0] as? Bool else {
            let message = "Enabled Parameter is Invalid."
            let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)
            // call error callback
            self.commandDelegate!.sendPluginResult(pluginResult, callbackId:command.callbackId)
            return
        }
        
        self.commandDelegate!.runInBackground({
            IMFLogger.setCapture(enabled)
        })
    }

    
    func setFilters(command: CDVInvokedUrlCommand){
        // parms: [filters]
        
        self.commandDelegate!.runInBackground({
            
            guard let filters  = (command.arguments[0] as? [NSObject:AnyObject]) else {
                let message = "Filters Object is Invalid."
                let pluginResult = CDVPluginResult(status: CDVCommandStatus_ERROR, messageAsString: message)
                // call error callback
                self.commandDelegate!.sendPluginResult(pluginResult, callbackId:command.callbackId)
                return
            }
            IMFLogger.setFilters(filters)
        })
    }
