popen mode repair