Adapted to latest pyoidc