Use communicate so process out does not deadlock