Fix is connected check bug