fix bug: incorrect error handling when server was not up