removed Popen wait and use communicate then get return code