modify login logic