Fix problem when login with an existing username.