added exception handling if server is not available