further working on state machine for users