Fixed issue while disconnecting