execption handling to the requests.get calls
added exception handling around ping