Disconnection Bugfixes

Fixed a bug about disconnecting from the server