Adding popWindow function