Fixed popup bug