update login logic