Fix another issue where the error handling routine could run twice