Update the JS binding code for plugin