big commit just to change the popup modal functionality