updated the login method to handle logged-in users.