use popen instead of subprocess.call