Fixed bug with popup window