switch to popen