added client login logic