modified for the new api