Handle stop button pressing from Extension

Hello, I’m trying to intercept the pressing of the stop button from my extension. Is there any method to do this?

I tried this following another answer on the forum, but it doesn’t work.

# callback
    def on_stage_event(event):
        print("Event ", event )
        if event.type == int(omni.usd.StageEventType.SIMULATION_START_PLAY):
            print("SIMULATION_START_PLAY")
        elif event.type == int(omni.usd.StageEventType.SIMULATION_STOP_PLAY):
            print("SIMULATION_STOP_PLAY")
        
    def on_startup(self, ext_id):
        # subscription 
        stage_event_sub = (omni.usd.get_context()
                        .get_stage_event_stream()
                        .create_subscription_to_pop(self.on_stage_event, name="subscription name"))

        world = World()
        ....

Thank you