Adding checks for internet connectivity.