logic moved from UI to WIFIUI