added better error checking of wget