Fix issue when an error is catch.