fixed a potential infinite loop in the error handler