with events and state with name