login and state set