Added try/except to prevent crashing if internet connection goes down.