detect wifi and use it