removed business logic from error handler