Adding login logic