almost fixed popup bug
Really fixed it this time