edit login logic