                     downloadModel.speed = (speedSize, speedUnit as String)
                     downloadModel.progress = progress
                     
-                    self.downloadingArray[index] = downloadModel
+                    if self.downloadingArray.contains(downloadModel), let objectIndex = self.downloadingArray.index(of: downloadModel) {
+                        self.downloadingArray[objectIndex] = downloadModel
+                    }
                     
                     self.delegate?.downloadRequestDidUpdateProgress(downloadModel, index: index)
                 })

    
    open var downloadingArray: [MZDownloadModel] = []
    
    public convenience init(session sessionIdentifer: String, delegate: MZDownloadManagerDelegate) {
        self.init()
        
        self.delegate = delegate
        self.sessionManager = backgroundSession(identifier: sessionIdentifer)
        self.populateOtherDownloadTasks()
    }
    
    public convenience init(session sessionIdentifer: String, delegate: MZDownloadManagerDelegate, completion: (() -> Void)?) {
        self.init(session: sessionIdentifer, delegate: delegate)
        self.backgroundSessionCompletionHandler = completion
    }
    
    fileprivate func backgroundSession(identifier: String) -> URLSession {
        let sessionConfiguration = URLSessionConfiguration.background(withIdentifier: identifier)
        let session = Foundation.URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: nil)
        return session
    }

                    let totalBytesCount = Double(downloadTask.countOfBytesExpectedToReceive)
                    let progress = Float(receivedBytesCount / totalBytesCount)
                    
                    let taskStartedDate = downloadModel.startTime ?? Date()
                    let timeInterval = taskStartedDate.timeIntervalSinceNow
                    let downloadTime = TimeInterval(-1 * timeInterval)
                    
