Fix how to get the error when something goes wrong