Added disconnect handling for csharp