Adding check before rollback. Some errors where due to try to rollback an already rolledback transaction