controls popup on load