allow custom error handler