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

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

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