changed logic for wifi and mobile checking