network connection logic improvement