change working directory when checking internet connection