updated to catch request errors (ex. server down)