fix this to work with new api