better wlan reconnection logic