switch to using built in urllib to check valid url
change exception
send error function