Added try catches so that it doesn't crash when not connected to the internet