Fixed to support new api