fixing popup bug