check internet

added the function to check whether user is connected to internet or not