improved error handling for rollback method