fix crash bug when there is no internet connection