working state machine for item. added flash messaging.