Correct logic of WIFI state related processes.