updated code for Model popups