fix bug in client.listen()