adapted to upstream changes that broke build at jul 6