consolidated stop music logic into one function