add basic error handler