Now removes popup element once closed