Added checking internet connection