Wifi connect logic