update to latest js api