improved error handling, fixed issue warning

errors now caught for connection errors other than 404