fix bugs on pop up windows