         }
         
         outputStream?.close()
-        outputStream?.remove(from: RunLoop.main, forMode: .init("kCFRunLoopDefaultMode"))
+        outputStream?.remove(from: .main, forMode: .common)
         outputStream = nil
     }
     

        inputStream.delegate = self
        outputStream.delegate = self
        
        inputStream.schedule(in: RunLoop.main, forMode: .init("kCFRunLoopDefaultMode"))
        //outputStream.schedule(in: RunLoop.main, forMode: .init("kCFRunLoopDefaultMode"))
        
        inputStream.open()

        outputStream?.delegate = nil
        
        inputStream?.close()
        inputStream?.remove(from: .main, forMode: .common)
        inputStream = nil
        
        // TOFIX: This sleep is a workaround for truncated file uploading
