add state machine to items