fix p.communicate handling