Fixed a bug that crashed the program when a device with IP is disconnected.