Fixed a bug that causes application to crash when internet connection is lost.