                                                     userId: self.userId,
                                                     alias: self.alias,
                                                 hadPersistedDistinctId: self.hadPersistedDistinctId), apiToken: self.apiToken)
+            if let completion = completion {
+                DispatchQueue.main.async(execute: completion)
+            }
         }
         
         if MixpanelInstance.isiOSAppExtension() {

            let properties = ["distinct_id": distinctId, "alias": alias]
            track(event: "$create_alias", properties: properties)
            identify(distinctId: distinctId, usePeople: usePeople)
            flush()
        } else {
            Logger.error(message: "alias: \(alias) matches distinctId: \(distinctId) - skipping api call.")
        }
    }
    
    /**
     Clears all stored properties including the distinct Id.
     Useful if your app's user logs out.
     */
    open func reset() {
        flush()
        trackingQueue.async { [weak self] in
            self?.readWriteLock.write { [weak self] in

     
     - parameter distinctId: string that uniquely identifies the current user
     - parameter usePeople: boolean that controls whether or not to set the people distinctId to the event distinctId.
                            This should only be set to false if you wish to prevent people profile updates for that user.
     - parameter completion: an optional completion handler for when the identify has completed.
     */
    open func identify(distinctId: String, usePeople: Bool = true, completion: (() -> Void)? = nil) {
        if hasOptedOutTracking() {
            return
        }
