According to a recent study published in the Quarterly Journal of Experimental Psychology, the melody that’s obsessively replaying in an endless loop can be stopped by popping some bubblegum.

The inability to get these infectious songs or melodies out of our heads, also known as “earworms,” are experienced by over 99 percent of individuals. “At a practical level, therefore, chewing gum can be recommended as an aid to reduce unwanted musical recollections,” wrote the researchers. Beaman’s study might have implications that go beyond a solution to earworm. This could be a stepping stone in developing methods of controlling invasive thoughts that fill the heads of those with psychiatric illnesses.

The next time you can’t get a song out of your head, pop a stick of gum in your mouth.