Completed the stateful chat event machine