fix build error for new api

thanks to david