adapted for new api