now tries submitting data to db only if urllib.urlopen succeeds