updated discovery flow to track errors