Adapt to new js interface