modified for new api
modified for new api