Added checking of Internet connection