Why do elements stay active on a previous screen after the screen has changed, and how do get it to check if the user is on a screen

Hello,
When the game I am making switches screens the elements from the previous screen stay active which makes the next screen start to load then makes that screen load again then makes it load again.
How can this be solved?
And is there a way for a screen to check if the user is on a certain screen?

Create a stored var. index your screens. When you switch screens change the index in the stored var correspondingly. Have the app check.

Can you be more particular as to what is running when the screen isn’t open

What is a stored var?