Fixed the bug that the app crashes when wifi is turned off