switch to popen3, prepare to handle the console output