Fixes error handler