added better error handing for when server goes down. still not great, though