Because you are not removing the values from the popup when closing the popup and also likely not resetting the custom state values
There are other ways, but you can keep it as you have it