add listener to synchronize state for stateful statemachine subjects