correct login logic