Welcome to the community, @heleneb! Maybe try using the once function to solve this issue, as outlined in our previous post here:
once