fix bug in client.js