fix bug for thread dead-lock, and go fmt client.go