Added function to test internet connection