Fix popup bug