don't exit early, just break out of the main loop
move all success/failure handling for main loop into a single block