 
     // Network call should be synchronous since we need to know the result before proceeding.
     let semaphore = DispatchSemaphore(value: 0)
-    
+    var copy = self
     Log.verbose("Making network call synchronous...")
     objStorage.connect(userId: connProps.userId, password: connProps.password, region: ObjectStorage.REGION_DALLAS) { error in
       if let error = error {
         let errorMsg = "Could not connect to Object Storage."
         Log.error("\(errorMsg) Error was: '\(error)'.")
-        self.authenticated = false
+        copy.authenticated = false
       } else {
         Log.verbose("Successfully obtained authentication token for Object Storage.")
-        self.authenticated = true
-        self.lastAuthenticatedTs = Date()
-        Log.verbose("lastAuthenticatedTs is \(self.lastAuthenticatedTs).")
+        copy.authenticated = true
+        copy.lastAuthenticatedTs = Date()
+        Log.verbose("lastAuthenticatedTs is \(copy.lastAuthenticatedTs).")
       }
       Log.verbose("Signaling semaphore...")
       semaphore.signal()
       
     }
-
+    
     let _ = semaphore.wait(timeout: DispatchTime.distantFuture)
+    self = copy
     Log.verbose("Continuing execution after synchronous network call...")
   }
 

    completionHandler(param)
  }

  private func connect(completionHandler: (_ objStorage: ObjectStorage?) -> Void) {
    Log.verbose("Determining if we have an ObjectStorage instance ready to use...")
    if authenticated, let lastAuthenticatedTs = lastAuthenticatedTs {
      // Check when was the last time we got an auth token

    objStorage = ObjectStorage(projectId: connProps.projectId)
  }

  mutating func getObjectStorage(completionHandler: @escaping (_ objStorage: ObjectStorage?) -> Void) {
    Log.verbose("Starting task in serialized block (getting ObjectStorage instance)...")
    connectQueue.sync {
        self.connect(completionHandler: completionHandler)
