adding custom error handler