made work with latest api changes