Fixed a bug when the app fails to connect to the server.