Not the most elegant solution but works for the most part with 1 popup.