added internet connection function