added check to se eif the user is connect to internet