fixed crash when disconnected from wifi