Fix error handler render error logic