adapt to new api