popup code fixed