redefine login logic