Fixes #1272, popup refresh was removing popup inappropriately