completed the JavaScript client