                 let s3Key = parameters[1] as? String ?? "notString"
                 let filePath = parameters[2] as? String ?? "notString"
                 // do call here
-                let error = "whatever"
-                let response = format(handler: handler, result: error)
-                controller.jsCallback(response: response)
-            } else {
-                let response = format(handler: handler, result: "downloadZipFile must have three parameters")
-                controller.jsCallback(response: response)
-            }
-
-        } else {
-            print("Unknown method \(method) in Plugin AWS")
+                error = "whatever"
+            } else {
+                error = logError(plugin: "AWS", method: method, message: "must have three parameters")
+            }
+            let response = format(handler: handler, result: error) // if error, return error
+            controller.jsCallback(response: response)
+
+        } else {
+            let error = logError(plugin: "AWS", method: method, message: "unknown method")
+            let response = format(handler: handler, result: error) // if error, return error
+            controller.jsCallback(response: response)
         }
     }
     
     private func audioPlayerPlugin(method: String, handler: String, parameters: [Any]) {
+        var error: String? = nil
         
         if method == "findAudioVersion" {
             if parameters.count == 2 {

                let silCode = parameters[3] as? String ?? "notString"
                let videoUrl = parameters[4] as? String ?? "notString"
                // do call here
                let response = handler + "();"
                controller.jsCallback(response: response)
            } else {
                let response = format(handler: handler, result: "showVideo must have five parameters")
                controller.jsCallback(response: response)
            }
        } else {
            print("Unknown method \(method) in Plugin VideoPlayer")
        }
    }
    
    private func format(handler: String, result: String) -> String {
        return handler + "('" + result + "');"
    }
    private func format(handler: String, result: Bool) -> String {
        return handler + "(" + String(result) + ");"

                let silCode = parameters[1] as? String ?? "notString"
                // do call here
                let bookList = "abcde"
                let response = format(handler: handler, result: bookList) // if error, return nil, else list
                controller.jsCallback(response: response)
            } else {
                logError(plugin: "AudioPlayer", method: method, message: "must have two parameters")
                let response = format(handler: handler) // if error, return nil
                controller.jsCallback(response: response)
            }

        } else if method == "isPlaying" {
            // do call here
            let isPlaying = true
            let response = format(handler: handler, result: isPlaying) // if error, return "F"
            controller.jsCallback(response: response)
            
        } else if method == "present" {
