generating the popup dynamically