updated to the new api