detects if the phone is connected to the internet