add wifi state check