update to new JS API