implemented the login state