added login state machine prototype