new wifi connection logic