fixed the JS-like API