Seems a little weird to use the DOM state to check if we have errors. Can we track as a module variable instead?