I'm thinking we should hide this whole block behind the check for if the flag is present rather than just the event listener itself.