Added login logic