adapt to api changes.