Added checks for when server is unavailable.