Added rollback for failed query.