Check for disconnected state in the Connect method