changed p.wait() to p.communicate()