Don't call submit after an error. Either chicken out with a `return` or move the submit call into an *else* branch. Dito below.