js: tweak for new api