Added initial error checking support
Checking for error when rolling back as well to be consistent