Fixed popup functionality