improve conventional error handler