Fix bug with the login process