fixes to the JS for WS