improved script test-client.js