Fix order of pushing the error handler