Now I want to dynamically monitor the close button in the upper right corner, is there any good way, thank you