Fix error in error handler