update the js interop code

This might work. I have not tested it.