Added some error messages when can not connect to server.