Fix a bug in login method of the Client class