Fixed behaviour when box is disconnected. Now we don't crash, and we also reconnect properly once it comes back.