fixing popup problem