check the register function — why isn't the changeToLogin() part working?