fixed bug with popup window