Fixing error handler