fix pwindow for popup handling