changes popen to use stdout and stderr args