Added on/off stack calls in the state manager.