add error handler support