Compatibility fix for api8