Fixed crash when connecting to other network