fixed popup behavior when reloaded