Move Popup close function under mainview content