Fixed popup window bug