added user login logic